do
###

echo "${top[i]}"

startYear=1995
endYear=2007

while [ ${startYear} -le ${endYear} ]
do
	for month in 01 02 03 04 05 06 07 08 09 10 11 12
	do 
		
####################
		echo "BEGIN {
	FS=\"\\t\"
	return_m=1
}

\$1 ~/${startYear}${month}[0-9][0-9]/{
	#if(\$6 != \"\") {
	#	temp=(\$6 + 1)
	#	return_m=return_m * temp
	#}
	print \$1 \"\\t\" \$2 \"\\t\" \$6
	
}

END {
	#print $startYear \"\\t\" $month \"\\t\" return_m - 1
}
" > caculate_return.1.awk
#####################
	awk -f caculate_return.1.awk ${top[i]}.${file}.month.return >> ${top[i]}.${file}.${startYear}.${month}.result
	done

startYear=$((startYear+1))	
done

	#cat caculate_return.tample.1.PL > caculate_return.PL
	#echo "open CONFIG, \"${top[i]}.\$file.\$year.\$month.result\";" >> caculate_return.PL
	#cat caculate_return.tample.2.PL >> caculate_return.PL
	perl caculate_return.PL $file ${top[i]} > ${top[i]}.$file.whole.return
	rm ${top[i]}*result
	#mv ${top[i]}*month.return ../


###
	i=$((i+1))
done



##
done

mv *.array.top50 ../
mv *.whole.return ../